package sh.wn36.vehiclemanage.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import sh.wn36.vehiclemanage.entity.QMenu;
import sh.wn36.vehiclemanage.service.QMenuService;
import sh.wn36.vehiclemanage.util.Result;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xk
 * @since 2021-04-26
 */
@RestController
@RequestMapping("/q-menu")
public class QMenuController {


    @Autowired
    private QMenuService qMenuService;

    @RequestMapping("/authorization")
    public HashMap<QMenu, List < QMenu >>authorization(){
        List<QMenu> byPid = qMenuService.findByPid(1);
        HashMap<QMenu, List < QMenu >> hashMap = new HashMap<QMenu ,List<QMenu>>();
        for (QMenu qMenu : byPid) {
            List<QMenu> byPid1 = qMenuService.findByPid(qMenu.getId());
            hashMap.put(qMenu,byPid1);

        }
        return hashMap;
    }


}

